import 'package:mobile_app.core/core/domain/entities/learning_content/lexical_item/lexical_item.dart';
import 'package:mobile_app.core/core/domain/services/tts_service/service.dart';
import 'package:mobile_app.home.core/core/domain/helpers/get_lexical_item_use_case_example/helper.dart';

abstract class PronounceLexicalItemUseCase {
  void call({
    required LexicalItemUseCase lexicalItemUseCase,
  });
}

class PronounceLexicalItemUseCaseImpl implements PronounceLexicalItemUseCase {
  const PronounceLexicalItemUseCaseImpl({
    required GetLexicalItemUseCaseExample getLexicalItemUseCaseExample,
    required TtsService ttsService,
  })  : _getLexicalItemUseCaseExample = getLexicalItemUseCaseExample,
        _ttsService = ttsService;

  final GetLexicalItemUseCaseExample _getLexicalItemUseCaseExample;
  final TtsService _ttsService;

  @override
  void call({
    required LexicalItemUseCase lexicalItemUseCase,
  }) {
    final useCaseExample = _getLexicalItemUseCaseExample(
      lexicalItemUseCase: lexicalItemUseCase,
    );

    _ttsService.speak(useCaseExample);
  }
}
